kill @e[type=armor_stand,tag=EFLock,scores={skTimeKe=100..}]
kill @e[type=armor_stand,tag=EFDizzy,scores={skTimeKe=100..}]

#正在执行effect的标题
scoreboard players set @a[scores={EFDisarm=..-5}] EFing 12
scoreboard players set @a[scores={EFDizzy=..-5}] EFing 12
scoreboard players set @a[scores={EFLock=..-5}] EFing 12
scoreboard players set @a[scores={EFLocks=..-5}] EFing 12
scoreboard players set @a[scores={EFReborn=..-5}] EFing 12
scoreboard players set @a[scores={EFUnControl=..-5}] EFing 12

#执行主标题
title @a[scores={EFing=12..}] title ""
title @a[scores={EFing=12..}] times 0 5 5

#检查
scoreboard players remove @a[scores={EFing=1..}] EFing 1
title @a[scores={EFing=0}] times 0 30 10
scoreboard players set @a[scores={EFing=0}] EFing -1

#无法选中


#免控：免疫缓慢、失明、漂浮、缓降及以上四种削弱效果
scoreboard players operation @a[scores={EFUnControl=1..}] EFUnControl *= SystemContrary System
execute as @a[scores={EFUnControl=..-1}] run title @s subtitle [{"text":"免控 ","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"EFUnControl","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute as @a[scores={EFUnControl=..-1}] run effect clear @s minecraft:slowness
execute as @a[scores={EFUnControl=..-1}] run effect clear @s minecraft:blindness
execute as @a[scores={EFUnControl=..-1}] run effect clear @s minecraft:levitation
execute as @a[scores={EFUnControl=..-1}] run effect clear @s minecraft:slow_falling
execute as @a[scores={EFUnControl=..-1}] run scoreboard players set @s EFLock 0
execute as @a[scores={EFUnControl=..-1}] run scoreboard players set @s EFLocks 0
execute as @a[scores={EFUnControl=..-1}] run scoreboard players set @s EFDizzy 0
execute as @a[scores={EFUnControl=..-1}] run scoreboard players set @s EFDisarm 0
scoreboard players add @a[scores={EFUnControl=..-1}] EFUnControl 1

#重生：死亡时在原地重生，生命值减半
spawnpoint @a[scores={EFReborn=0},nbt=!{DeathTime: 1s}] ~ 0 ~
scoreboard players operation @a[scores={EFReborn=1..}] EFReborn *= SystemContrary System
execute as @a[scores={EFReborn=..-1}] run title @s subtitle [{"text":"重生 ","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"EFReborn","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute as @a[scores={EFReborn=..-1}] at @s run spawnpoint @a[scores={EFReborn=..-1}] ~ ~1 ~ ~
scoreboard players add @a[scores={EFReborn=..-1}] EFReborn 1

#禁锢：无法移动，但可以攻击
execute as @a[scores={EFLock=1..}] at @s run summon minecraft:armor_stand ~ ~ ~ {Tags: ["EFLock"], Marker: 1b, NoGravity: 1b, Invisible: 1, NoBasePlate: 1, Rotation: [0f]}
scoreboard players operation @a[scores={EFLock=1..}] EFLock *= SystemContrary System
execute as @a[scores={EFLock=..-1}] run title @s subtitle [{"text":"禁锢 ","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"EFLock","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
effect give @a[scores={EFLock=..-20}] slow_falling 1 0 true
execute as @a[scores={EFLock=..-1}] at @s run tp @s ~ ~ ~ ~ ~
execute as @a[scores={EFLock=..-1}] at @s at @e[type=armor_stand,tag=EFLock,distance=0..1.2,limit=1,sort=nearest] run tp @s ~ ~ ~
scoreboard players add @a[scores={EFLock=..-1}] EFLock 1

#眩晕：无法移动，受到失明效果影响，在受到眩晕时，视角被动朝下，之后可调整视角
execute as @a[scores={EFDizzy=1..}] at @s run summon minecraft:armor_stand ~ ~ ~ {Tags: ["EFDizzy"], Marker: 1b, NoGravity: 1b, Invisible: 1, NoBasePlate: 1, Rotation: [0f]}
execute as @a[scores={EFDizzy=1..}] at @s run tp @s ~ ~ ~ ~ 90
scoreboard players operation @a[scores={EFDizzy=1..}] EFDizzy *= SystemContrary System
execute as @a[scores={EFDizzy=..-1}] run title @s subtitle [{"text":"眩晕 ","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"EFDizzy","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
effect give @a[scores={EFDizzy=..-20}] slow_falling 1 0 true
effect give @a[scores={EFDizzy=..-20}] blindness 2 0 true
execute as @a[scores={EFDizzy=..-1}] at @s at @e[type=armor_stand,tag=EFDizzy,distance=0..1.2,limit=1,sort=nearest] run tp @s ~ ~ ~
scoreboard players add @a[scores={EFDizzy=..-1}] EFDizzy 1

#封锁：主要技能停止冷却
scoreboard players operation @a[scores={EFLocks=1..}] EFLocks *= SystemContrary System
execute as @a[scores={EFLocks=..-1}] run title @s subtitle [{"text":"封锁 ","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"EFLocks","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
scoreboard players add @a[scores={EFLocks=..-1}] EFLocks 1

#缴械：无法进行物理攻击
scoreboard players operation @a[scores={EFDisarm=1..}] EFDisarm *= SystemContrary System
execute as @a[scores={EFDisarm=..-1}] run title @s subtitle [{"text":"缴械 ","color":"red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"EFDisarm","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
effect give @a[scores={EFDisarm=..-20}] weakness 1 9 false
scoreboard players add @a[scores={EFDisarm=..-1}] EFDisarm 1